package com.example.mymicaihu.presenter;

import com.example.mvplibrary.callback.BaseModelCallback;
import com.example.mvplibrary.presenter.BasePresenter;
import com.example.mymicaihu.callback.Mainconcations;
import com.example.mymicaihu.model.MainModel;

import java.util.HashMap;

/**
 * 作者：朱勇闯
 * data : 2021/4/25  9:52
 * 作用： xxxx
 */
public class MainPresenter<T> extends BasePresenter<Mainconcations.MainView, MainModel> implements BaseModelCallback<T> {
    @Override
    public void onError(String message, int code) {
        getView().showError(message);
    }

    @Override
    public void onSuccess(T t, int type) {
        getView().showList(t, type);
    }

    public void getData(HashMap<String, Object> paramser, String baseUrl, String ApiUrl, int type){
        getModel().getData(this, getLifecycleProvider(), paramser, baseUrl, ApiUrl, type);
    }
}
